﻿using System;
using System.Data;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;
using CookstaFramework.Objects;

namespace CookstaFramework.Data
{
	/// <summary>
	/// Description of DatabaseAccess.
	/// </summary>
	public static class DatabaseAccess
	{
		public static SqlConnection sqlConn;
		public static MySqlConnection mysqlConn;
		
		public static RecordCollection<T> RecordReader<T>(string connectionString, string sql, DatabaseType databaseType) where T : RecordBase
		{
			switch (databaseType) {
				case CookstaFramework.Data.DatabaseType.SQL:
					//return SqlRecordReader<T>(sql);
					break;
				case CookstaFramework.Data.DatabaseType.MySql:
					//return MySqlRecordReader<T>(sql);					
					break;
				default:
					throw new Exception("Invalid value for DatabaseType");
			}
			return null;			
		}
/*		
		private static RecordCollection<T> SqlRecordReader<T>(string sql) where T : RecordBase
		{
					
		}
		
		private static RecordCollection<T> MySqlRecordReader<T>(string sql) where T : RecordBase
		{
			
		}
*/
		
	}
	
	public enum DatabaseType
	{
		SQL,
		MySql
	}
}
